// UserIO ADT header file
//Faith Or

#ifndef UserIO
#define UserIO


/* fare outputs "Thank You" message                               */
/* Pre:  none                                                     */
/* Post:   "Thank You"                                            */
/* Return: none                                                   */
/* Written by: Faith Or                                           */
void fare(void);

/* menuOption shows the options a user can do and process the choice */
/* Pre:  none                                                        */
/* Post:   char, the option                                          */
/* Return: char--containing the user's choice                        */
/* Written by: Faith Or                                              */
void menuOption(void);

/* rollText prints text in typewriter animation                      */
/* Pre:  the text string                                             */
/* Post:   prints out string to output                               */
/* Return: none                                                      */
/* Written by: Faith Or                                              */
void rollText(char *text);

/* delay function delays the program in executing for a certain time */
/* Pre:  seconds                                                     */
/* Post: delay program execution                                     */
/* Return: none                                                      */
/* Written by: Faith Or                                              */
void delay(long seconds);

//Deletes all the data in the stack, leaving it empty
/* ClearStack deletes all the data in the stack and frees them       */
/* Pre:  stack exists                                                */
/* Post: Stack is empty                                              */
/* Return: none                                                      */
/* Written by: Faith Or                                              */
void ClearStack(STACK *Ptr);

/* CheckEx is checks if the key string given by the user is not a    */
/* duplicate.                                                        */
/* Pre:  string,Hash and targetIndex is intitalized                  */
/* Post: checked if user's given string exists in Hash               */
/* Return: 1 if there's a duplicate and 0 if not                     */
/* Written by: Faith Or                                              */
int checkEx(char *str, HASH *pHash,int *targetIndex, int arr_size);

/* CheckEx is checks if the key string given by the user is not a             */
/* duplicate.                                                                 */
/* Pre:  string, Hash and targetIndex is intitalized                          */
/* Post: if there are no conflicts, data in stack is added into Hash and Bst  */
/*       if there are conflicts by user's preference:                         */
/*       Deletes stack data or deletes existing entry and adds the stack data */
/* Return: none                                                               */
/* Written by: Faith Or                                                       */
void undoDelManager(STACK *ptr, BST *bst, HASH *pHash, int arr_size);

/* searchManager searches for the person in the database given by the user    */
/* through the Hash                                                           */
/* Pre:  Hash and Bst exists                                                  */
/* Post: if found, displays the info about person                             */
/*       if not found return                                                  */
/*       if there's no data in database, return                               */
/* Return: none                                                               */
/* Written by: Faith Or                                                       */
void searchManager(HASH *pHash, BST *bst, int arr_size);

/* listHashManager lists the list of data in Hash table sequence              */
/* Pre:  Hash and Bst exists                                                  */
/* Post: if there are no records return                                       */
/*       if there are, list them in array sequence                            */
/* Return: none                                                               */
/* Written by: Faith Or                                                       */
void listHashManager(HASH *pHash, BST *bst, int arr_size);

/* listBstManager prints out the BST list at user's prompt           */
/* Pre:    BST list has been initialized                             */
/* Post:   list printed out to screen                                */
/* Return: none                                                      */
/* Written by: Faith Or                                              */
void listBstManager(BST* list);

/* print_data prints the data of one structure                       */
/* Pre:    task1 exists                                              */
/* Post:   data from task1 is printed out                            */
/* Return: none                                                      */
/* Written by: Faith Or                                              */
void print_data(void* Soldier1);

/* VerValidChr  checks if user input contains valid characters       */
/* Pre: none                                                         */
/* Post: returns a vaild number                                      */
/* Return: int                                                       */
/* Written by: Faith Or                                              */
void VerValidChr(char *cpy, int option);

/* VerValidNum  checks if user input contains valid numbers          */
/* Pre: none                                                         */
/* Post: returns a vaild number                                      */
/* Return: int                                                       */
/* Written by: Faith Or                                              */
int VerValidNum(void);




#endif